import Layout from "@/layout";
import Year from "@/pages/year"
import Month from "@/pages/month";
import New from "@/pages/new";

const { createBrowserRouter } = require("react-router-dom");

const router = createBrowserRouter([
    {
        path: "/",
        element: <Layout />,
        children: [
            {
                index: true,
                element: <Month />,
            },
            {
                path: "/year",
                element: <Year />,
            },
        ],
    },
    {
        path: "/new",
        element: <New />,
    },
    {
        path: "*",
        element: () => import("@/pages/error"),
    },
]);

export default router;